{% extends 'no_login_base.html' %}
{% load i18n %}
{% load allauth %}
{% load crispy_forms_tags %}

{% block content %}
<form class="card card-md" method="post">
  <div class="card-body">
    <h2 class="card-title text-center mb-4">
      {% if token_fail %}
        {% trans "Bad Token" %}
      {% else %}
        {% trans "Change Password" %}
      {% endif %}
    </h2>
    <div class="mb-3">
      {% if token_fail %}
        {% url 'account_reset_password' as passwd_reset_url %}
        <p>
            {% blocktrans %}The password reset link was invalid, possibly because it has already been used.  Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}
        </p>
      {% else %}
        {% csrf_token %}
        {{ form|crispy }}
      {% endif %}
    </div>
    {% if not token_fail %}
      <div class="form-footer">
        <button type="submit" class="btn btn-primary w-100">
          {% translate "Change password" %}
        </button>
      </div>
    {% endif %}
  </div>
</form>
{% endblock %}
